/**
* Created by meizhao on 2020-03-27.
*/

<template>
  <div class="const">
    <div class="login">
      <div class="logo">
        <img src="../../../assets/logo2.png">
      </div>
      <div class="conatainer">
        <div class="list" style="margin-bottom: 63px">
          <img class="icons" src="../../../assets/yonghu.png">
          <input type="text" placeholder="请输入用户名" v-model="userName"/>
        </div>

        <div class="list" style="margin-bottom: 63px">
          <img class="icon" src="../../../assets/mima.png">
          <input type="text" placeholder="请输入密码" v-model="userName"/>
        </div>
        <div class="btn-login">登录</div>
        <div></div>
      </div>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
  import { getUserAllInfo,updateUserInfo} from '../../../api/index.js'
  import axios from 'axios'
  export default{
    data(){
      return{
        code:''
      }
    },
    methods: {
    },
    mounted(){
      dd.runtime.permission.requestAuthCode({
        corpId: "dingb7033fdcf00adfad35c2f4657eb6378f",
        async onSuccess(result) {
          const data = {
            code: JSON.stringify(result.code),
          }
          let response = await updateUserInfo(data)
          alert(JSON.stringify(response))
          if(response.code==10000){
            this.$router.push({path:'../Message'})
          }else{
            alert('登录失败')
          }
        },
        onFail : function(err) {}

      })
    },
  }
</script>
<style lang="stylus" rel="stylesheet/stylus" scoped>
  .const
    .login
      .logo
        width: 268px;
        height: 287px;
        object-fit: cover;
        border-radius: 13px;
        display: block;
        margin: 0 auto;
        margin-top: 150px;
        position: relative;
        img
          width: 100%
          height: 100%
      .conatainer
        padding 170px 70px
        .list
          display: flex;
          align-items: center;
          border-bottom: 1px solid rgba(127, 127, 127, .25);
          padding-bottom: 11px;
          padding-left: 14px;
          input
            margin-left: 20px;
            color: #040639;
            font-size: 30px;
            line-height: 30px;
            margin-right: auto;
          .icon
            width: 33px;
            height: 33px;
          .icons
            width: 33px;
            height: 33px;
        .btn-login
          width: 100%;
          height: 80px;
          background-image: linear-gradient(#00BAFF, #0B9BEE);
          border-radius: 40px;
          color: #fff;
          line-height: 80px;
          font-size: 30px;
          text-align: center;
          letter-spacing: 40px;
          margin-top: 47px;
          text-indent: 40px;

</style>
